package com.qzh.QLanguage.ElementAnalyse;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

/**
 * 环境池
 */
public class QLEnvironment {
    /**
     * 预先定义的类池
     */
    private final HashMap<String,ElementClass> preparedDefinedElementClassList = new HashMap<>();
    /**
     * 预先定义的方法池
     */
    private  final HashMap<String,ElementMethod> preparedDefinedElementMethodList = new HashMap<>();
    /**
     * 定义的类池
     */
    private final HashMap<String,ElementClass> definedElementClassList = new HashMap<>();
    /**
     * 定义的方法池
     */
    private final HashMap<String,ElementMethod> definedElementMethodList = new HashMap<>();

    /**
     * 根据方法名检测预定义方法池中是否包含该方法
     */
    public boolean checkPrepareMethodInclude(String methodName){
      return   preparedDefinedElementClassList.containsKey(methodName);
    }
    /**
     * 根据方法名检测用户定义方法池中是否包含该方法
     */
    public boolean checkDefinedMethodInclude(String methodName){
        return   definedElementMethodList.containsKey(methodName);
    }
    /**
     * 根据方法名检测预定义类池中是否包含该类
     */
    public boolean checkPrepareClassInclude(String className){
        return   preparedDefinedElementClassList.containsKey(className);
    }
    /**
     * 根据方法名检测用户定义类池中是否包含该类
     */
    public boolean checkDefinedClassInclude(String className){
        return   definedElementClassList.containsKey(className);
    }









}
